<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>06 js 判断数据类型</title>
</head>
<body>
    <pre>

    </pre>

    <script>
        // console.log(typeof []);  //object
        // console.log({});  //object

        // var arr = [];
        // console.log(arr instanceof Array);  //true

        // console.log(Object.prototype.toString.call('123'));
        // console.log(Object.prototype.toString.call(123));
        // console.log(Object.prototype.toString.call([]));
        // console.log(Object.prototype.toString.call({}));
        // console.log(Object.prototype.toString.call(true));
        // console.log(Object.prototype.toString.call(new Date));
        // console.log(Object.prototype.toString.call(undefined));
        // console.log(Object.prototype.toString.call(null));
        
		// 判断数据类型的几种方式
		// typeof
		console.group('typeof');
		console.log('Object:', '[]', typeof []);
		console.log('Number:', 123, typeof 123);
		console.log('String:', '123', typeof '123');
		console.log('Boolean:', true, typeof true);
		console.log('Undefined:', 'a', typeof a);
		console.log('--------------------');
		console.log('Object:', typeof Object);
		console.log('Array:',typeof Array);
		// console.log('function:', typeof function);
		console.log('String:', typeof String);
		console.log('boolean:', typeof Boolean);
		console.log('undefined:', typeof undefined);
		console.log('Number:', typeof Number);
		console.log('null:', typeof null);
		console.groupEnd();
		

    </script>
</body>
</html>